package com.geek.javase.ch15.work.productionlock;

import java.util.concurrent.TimeUnit;

/*
 *@author wangpeng
 *2025/10/31 20:30
 *@description
 */
public class Test {

    public static void main(String[] args) {
        //共同资源
        House house = new House();

        //启动生产者
        Thread tA = new Thread(new Product(house), "生产者A");
        tA.start();
        Thread tC = new Thread(new Product(house), "生产者C");
        tC.start();
        //启动消费者
        Thread tB = new Thread(new Consumer(house), "消费者B");
        tB.start();
        Thread tD = new Thread(new Consumer(house), "消费者D");
        tD.start();

    }

}
